package com.dao.cook.impl;

import java.util.List;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;

import com.dao.cook.CookDaoL;
import com.po.CookL;
import com.po.OrderL;
@Repository
public class CookDaoImpL implements CookDaoL {
	@Resource(name="sqlSessionTemplate")
	private SqlSessionTemplate sqlSessionTemplate;
	@Override
	public int addCook(CookL cook) {
		int result = sqlSessionTemplate.insert("addCookL", cook);
		return result;
	}
	@Override
	public List<OrderL> getOrderList() {
		List<OrderL> orderlist = sqlSessionTemplate.selectList("getOrderListL");
		return orderlist;
	}
	@Override
	public List<OrderL> getOrderListByStatus(OrderL order) {
		List<OrderL> orderlist = sqlSessionTemplate.selectList("getOrderListByStatusL",order);
		return orderlist;
	}

	@Override
	public int updateOrderStatus(OrderL order) {
		int result = sqlSessionTemplate.update("updateOrderStatusL", order);
		return result;
	}
	@Override
	public List<OrderL> getOrderListByDate(String order) {
		List<OrderL> orderlist = sqlSessionTemplate.selectList("getOrderListByDateL",order);
		return orderlist;
	}
	@Override
	public CookL findCookInfo(CookL cook) {
		return sqlSessionTemplate.selectOne("findCookInfoL", cook);
	}
	@Override
	public List<OrderL> getOrderListNoCheck() {
		List<OrderL> orderlist = sqlSessionTemplate.selectList("getOrderListNoCheckL");
		return orderlist;
	}
	@Override
	public List<OrderL> getOrderListInfoById(OrderL order) {
		List<OrderL> orderlist = sqlSessionTemplate.selectList("findOrderListInfoByIdL",order);
		return orderlist;
	}
	@Override
	public List<OrderL> getOrderListNoCheckInfoById(OrderL order) {
		List<OrderL> orderlist = sqlSessionTemplate.selectList("getOrderListNoCheckInfoByIdL",order);
		return orderlist;
	}
	@Override
	public List<OrderL> getOrderListByDateInfoById(OrderL order) {
		List<OrderL> orderlist = sqlSessionTemplate.selectList("getOrderListByDateInfoByIdL",order);
		return orderlist;
	}
	

}
